/*
 * @Date: 2023-08-07 15:45:52
 * @LastEditors: lyx
 * @LastEditTime: 2023-08-08 10:47:25
 * @FilePath: \sup-mini-app\src\pages\index\model.ts
 * @Description:
 */
// import * as homeApi from './service';

export default {
  namespace: "home",
  state: {
    currentTag: { name: "我的测试", desc: "啊啊desc" },
    weather: {
      province: "北京",
      city: "东城区",
      adcode: "110101",
      weather: "多云",
      temperature: "27",
      winddirection: "南",
      windpower: "≤3",
      humidity: "72",
      reporttime: "2023-08-07 16:02:59",
      temperature_float: "27.0",
      humidity_float: "72.0",
    },
    dailyEnglish: {
      adUrl: "",
      audiourl: "",
      channelId: 2,
      channelName: "精选专栏",
      comment: 0,
      downloadable: false,
      endTime: 209912310000,
      gif: [
        "http://oimagea6.ydstatic.com/image?id=8347767471908008006&product=dict-homepage&w=720&h=450&fill=0&cw=720&ch=450&sbc=0&cgra=CENTER&of=jpeg",
      ],
      id: "978559",
      image: [
        "http://oimagea6.ydstatic.com/image?id=8347767471908008006&product=dict-homepage&w=190&h=160&fill=0&cw=190&ch=160&sbc=0&cgra=CENTER&of=jpeg",
      ],
      injectAdvJs: false,
      keywords: ["写作表达"],
      like: 0,
      media: "ARTICLE",
      shape: "SMALL",
      showArticle: true,
      showcomment: false,
      showlike: false,
      source: "",
      startTime: 202308080000,
      style: "daily",
      subscribed: false,
      summary: "秋天到了。",
      tagurl: "上滑更多精彩",
      title: "It's autumn time.",
      type: "壹句",
      url: "",
      videourl: "",
      visitnum: 0,
      voiceSize: 0,
    },
    bannerList: [
      {
        id: "1",
        title: "title1",
        url: "https://img10.360buyimg.com/babel/s700x360_jfs/t25855/203/725883724/96703/5a598a0f/5b7a22e1Nfd6ba344.jpg!q90!cc_350x180",
      },
      {
        id: "2",
        title: "title2",
        url: "https://img14.360buyimg.com/babel/s700x360_jfs/t1/4099/12/2578/101668/5b971b4bE65ae279d/89dd1764797acfd9.jpg!q90!cc_350x180",
      },
      {
        id: "3",
        title: "title3",
        url: "https://img11.360buyimg.com/babel/s700x360_jfs/t1/4776/39/2280/143162/5b9642a5E83bcda10/d93064343eb12276.jpg!q90!cc_350x180",
      },
    ],
  },
  effects: {
    *load(_, { call, put }) {
      // const { status, data } = yield call(homeApi.homepage, {});
      // if (status === 'ok') {
      //   yield put({
      //     type: 'save',
      //     payload: {
      //       banner: data.banner,
      //       brands: data.brands,
      //     },
      //   });
      // }
    },
  },
  reducers: {
    save(state, { payload }) {
      return { ...state, ...payload };
    },
  },
};
